package com.blog4j.api.config;

import cn.hutool.core.util.RandomUtil;
import com.blog4j.common.constants.CommonConstant;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.context.annotation.Configuration;

/**
 * @author 98k灬
 * @version v1.0.0
 * @Description : feign添加请求头
 * @Create on : 2024/8/25 20:58
 **/
@Configuration
public class FeignRequestInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate template) {
        template.header(CommonConstant.INNER_ACCESS_TOKEN, RandomUtil.randomString(6));
    }
}
